package com.pine.app.module.security.oauth.config.properties;


import com.pine.app.module.security.core.common.AuthConstant;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 认证配置信息
 * @author xyjxust
 * @create 2019/3/14 14:52
 **/
@Data
@Configuration
@ConfigurationProperties(prefix = OAuth2Properties.OAUTH_PROPERTIES)
public class OAuth2Properties {

    public static final String OAUTH_PROPERTIES = "pine.oauth";
    /**
     *  配置JWT格式化Oauth2返回的token
     */
    private Jwt jwt = new Jwt();

    /**
     * 票据配置信息
     */
    private Tgt tgt = new Tgt();



    /**
     * 自定义Jwt相关的配置
     */
    @Data
    public class Tgt {
        /**
         * 开关
         */
        private boolean enable = false;
        /**
         *  票据过期时间
         */
        private Long expire =AuthConstant.LOGIN_ATTEMP_EXPIRE;
    }

    /**
     *  自定义Jwt相关的配置
     */
    @Data
    public class Jwt {
        /**
         * 开关
         */
        private boolean enable = false;
        /**
         * jwt的密钥
         */
        private String signKey = "pine";
    }


}
